package com.geyue.common.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Lyon on 2017/5/17.
 */
public class DateUtils {

    public static Date format(String value,String pattern) {

        if(StrUtils.isEmpty(value) || StrUtils.isEmpty(pattern))
            return null;

        try {
            SimpleDateFormat sdf = new SimpleDateFormat(pattern);
            Date date = sdf.parse(value);
            return date;
        } catch (Exception e) {
            e.printStackTrace();;
        }
        return null;
    }
}
